package main

import (
	"net/http"
	"fmt"
	"io/ioutil"
	"time"
	"log"
	"runtime"
)

func main()  {
	runtime.GOMAXPROCS(runtime.NumCPU())
	for i:=0;i<10000;i++  {
		go func() {
			resp, err := http.Get("http://210.45.168.2/")
			if err != nil {
				log.Fatal(err)
			}
			defer resp.Body.Close()
			ioutil.ReadAll(resp.Body)
			//fmt.Println(string(body))
		}()
	}
	cpuNum := runtime.NumCPU()
	goroutineNum := runtime.NumGoroutine()
	fmt.Println(int(cpuNum),int(goroutineNum))
	time.Sleep(time.Second*100)
}
